﻿//AcademicPlanner - course registration planning web app.
//Copyright (C) 2009  Boubacar Diallo

//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcademicPlanner.Data.Entities
{
	/// <summary>
	/// AcademicPeriodEntity represents an academic period.
	/// </summary>
	/// <remarks>
	/// A AcademicPeriodEntity is a NHibernate component object.
	/// </remarks>
	/// <since>1.0</since>
	public class AcademicPeriodEntity : Entity
    {
		/// <summary>
		/// Gets or sets the year of this AcademicPeriodEntity.
		/// </summary>
		/// <since>1.0</since>
		public virtual int Year { get; set; }

		/// <summary>
		/// Gets or sets the <c>AcademicTermEntity</c> of this AcademicPeriodEntity.
		/// </summary>
		/// <since>1.0</since>
		public virtual AcademicTermEntity TermEntity { get; set; }


		/// <summary>
		/// Sets default values for this AcademicPeriodEntity's properites.
		/// </summary>
		/// <remarks>
		/// <list type="bullet">
		///		<item><c>Year</c> is set to the current year.</item>
		/// </list>
		/// </remarks>
		/// <since>1.0</since>
		public override void SetDefaults()
		{
			base.SetDefaults();
			Year = DateTime.Now.Year;
		}
    }
}
